package com.how2j.springcloud.client;

import com.how2j.springcloud.pojo.Product;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: kaiyi
 * @create: 2020-10-23 23:39
 */
@Component
public class ProductClientRibbon {

  @Resource
  public RestTemplate restTemplate;

  public List<Product> listProdcuts() {
    return restTemplate.getForObject("http://PRODUCT-DATA-SERVICE/products", List.class);
  }
}
